package Homework0811;

import java.util.Arrays;
import java.util.Objects;

public class LowerArr {
    private final char[] arr;

    public LowerArr(char[] arr)
    {
        this.arr=new char[arr.length];
        for(int i=0;i<arr.length;i++)
        {
            if(arr[i]>='A'&&arr[i]<='Z')
            {
                this.arr[i]=(char)(arr[i]+32);
            }
            else
            {
                this.arr[i]=arr[i];
            }
        }
    }

    @Override
    public String toString() {
        String s = new String(arr);
        return s;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        LowerArr lowerArr = (LowerArr) o;
        return Objects.deepEquals(arr, lowerArr.arr);
    }

    @Override
    public int hashCode() {
        return Arrays.hashCode(arr);
    }
}
